package com.magic.gre.mvp.model;

import com.magic.gre.Api;
import com.magic.gre.helper.Contract;
import com.magic.gre.mvp.contract.AvtivityContract;
import com.noname.lib_base_java.mvp.BaseModelImpl;
import com.noname.lib_base_java.net.RtManager;

import io.reactivex.Observable;
import io.reactivex.Observer;
import okhttp3.ResponseBody;

/**
 * Author: Lmoumou
 * Date: 2019-01-07 15:29
 * 文件名: AvtivityModelImpl
 * 描述:
 */
public class AvtivityModelImpl extends BaseModelImpl implements AvtivityContract.Model{
    @Override
    public void mActivityList(Observer<ResponseBody> observer, int pageNo) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).activityList(pageNo, Contract.PAGER_SIZE);
        doHttp(observer,observable);
    }

    @Override
    public void mActApply(Observer<ResponseBody> observer, String activityId,String wechatNum) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).actApply(activityId, wechatNum);
        doHttp(observer,observable);
    }

    @Override
    public void mActDetails(Observer<ResponseBody> observer, String activityId,String device) {

        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).actDetail(activityId,device);

        doHttp(observer,observable);
    }
}
